[DO NOT MERGE!] docs: document PWCS cancellation feature [RED-511]#308
[DO NOT MERGE!] docs: document PWCS cancellation feature [RED-511]#308miliberlin wants to merge 5 commits into
Conversation
- New concepts/cancellation.mdx covering cancellation surfaces, post-cancel flow, and API versioning
- New api-reference/cancel/cancel-a-session.mdx for POST /v1/cancel
- New v2 check-session reference pages (trigger, retrieve, await completion)
- Sidebar entries in docs.json for the above
- Cross-links from concepts/results.mdx, communicate/alerts/configuration.mdx
- Ctrl+C cancellation sections in cli/checkly-{pw-test,test,trigger,deploy}.mdx
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| ## Cancelling a run | ||
|
|
||
| {/* TODO: confirm CLI version that ships pw-test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships pw-test Ctrl+C handling (RED-375), or remove this Note if Ferran prefers a generic call-out. The Linear ticket is still in In Review.
| {/* TODO: confirm CLI version that ships pw-test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| Press <kbd>Ctrl</kbd>+<kbd>C</kbd> during a `checkly pw-test` run to cancel the test session. The CLI sends a cancel request and waits for the runner to stop. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> a second time exits the CLI without waiting. |
There was a problem hiding this comment.
Verify the Ctrl+C UX matches what shipped: "no detach prompt; second Ctrl+C exits without waiting." I took this from the project spec (RED-375), not from reading the CLI source.
| ## Cancelling a run | ||
|
|
||
| {/* TODO: confirm CLI version that ships test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships checkly test Ctrl+C handling (was RED-373, marked Duplicate — verify it actually shipped), or remove this Note.
| {/* TODO: confirm CLI version that ships test Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| When you started the run with `--record`, pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> prompts you to either **cancel** the recorded test session in Checkly or **detach** and let it finish in the background. Detach is the default. Cancellation only applies to Playwright Check Suite runs inside the session. |
There was a problem hiding this comment.
Verify "cancel or detach, detach is default" matches what shipped. RED-373 was marked Duplicate so I'm not 100% sure this is the final UX.
| ## Cancelling a run | ||
|
|
||
| {/* TODO: confirm CLI version that ships trigger Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships checkly trigger Ctrl+C handling (RED-373 dup), or remove this Note.
| {/* TODO: confirm CLI version that ships trigger Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| When you started the run with `--record`, pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> prompts you to either **cancel** the recorded test session in Checkly or **detach** and let it finish in the background. Detach is the default. Cancellation only applies to Playwright Check Suite runs inside the session. |
There was a problem hiding this comment.
Same UX question as in checkly-test.mdx — confirm "detach is the default" is accurate.
| ## Cancelling a deploy | ||
|
|
||
| {/* TODO: confirm CLI version that ships deploy Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> |
There was a problem hiding this comment.
Fill in the CLI version that ships checkly deploy Ctrl+C handling (RED-374 dup), or remove this Note.
| {/* TODO: confirm CLI version that ships deploy Ctrl+C handling and fill in the Note below. */} | ||
| <Note>Available in CLI vX.X+.</Note> | ||
|
|
||
| `checkly deploy` may run [Playwright Check Suites](/detect/synthetic-monitoring/playwright-checks/overview) as part of post-deploy verification. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> during that phase prompts you to either **cancel** the recorded check session or **detach** and let it finish in the background. Detach is the default. |
There was a problem hiding this comment.
Confirm: (1) checkly deploy actually runs PWCS as part of post-deploy verification today — is that universally true or only when configured? (2) "detach is the default" matches what shipped.
Match the convention used by check-groups and check-results: v1 MDX pages get deprecated: true when a v2 equivalent exists. Updates the matching ResponseField label in concepts/cancellation.mdx from backwards-compatible to deprecated for consistency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The v2 OpenAPI entries have no description fields, so the auto-rendered pages were blank. Carry the v1 description text forward in the MDX body and add a What's new in v2 note covering the CANCELLED status value and isCancelled result flag. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The /v1/cancel OpenAPI entry has no description, so the auto-rendered page only showed the request schema. Add MDX body content explaining the discriminated body (checkSessionId vs testSessionId), the optional sequenceId narrowing, and the Playwright-only constraint, with a link out to the cancellation concept page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| The successful response of this endpoint is equivalent to the [retrieve a check session](/api-reference/check-sessions/retrieve-a-check-session-v2) endpoint's response for a completed check session. | ||
|
|
||
| <Note> | ||
| **What's new in v2:** `status` may return the new `CANCELLED` value for sessions that were [cancelled](/concepts/cancellation), and every per-result object includes an `isCancelled` boolean. v1 clients continue to work unchanged and never see these additions. |
There was a problem hiding this comment.
for v1, cancelled is mapped to TIMED_OUT
There was a problem hiding this comment.
Good point, added that!
The only v2-only addition is the CANCELLED status enum value; v1 maps cancelled sessions to TIMED_OUT. The isCancelled boolean on per-result objects is additive and present in both versions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Documenting the cancellation behaviour. Let me know if anything should be removed or added elsewhere. Will need some more adjusting along the line (CLI version, etc.) and we need some more updates on the OpenAPI specs to correctly display the new endpoints in the API docs as documented here RED-511: [Docs] Update docs. Feel free to give it a read already.
Summary
Documents the Playwright Check Suite cancellation feature shipping under Allow cancellation of PWCS runs & test sessions (RED-511).
New pages
concepts/cancellation.mdx— explains what can be cancelled (check session vs. test session), how to cancel from UI/API/CLI, what happens after a run is cancelled (no alerts, excluded from metrics, no automated incidents), and the v1/v2 API versioning split.api-reference/cancel/cancel-a-session.mdx— pullsPOST /v1/cancelfrom the OpenAPI spec, with body content explaining the discriminated request body and the Playwright-only constraint.api-reference/check-sessions/{trigger,retrieve,await-completion}-v2.mdx— three new pages mirroring the existing v1 reference pages. Each carries the v1 description forward and adds a "What's new in v2" Note.Sidebar
docs.jsongets aCancelgroup in the API Reference tab, three new v2 entries underCheck Sessions, and aconcepts/cancellationentry under Concepts.v1 deprecation markers
deprecated: truein frontmatter, matching the convention used bycheck-groups,check-results,checks, andtriggerswhen a v2 replacement exists.Cross-links and call-outs
concepts/results.mdx— short Note linking to the cancellation page.communicate/alerts/configuration.mdx— Note in the configuration-hierarchy section stating cancelled runs never trigger alerts.cli/checkly-{pw-test,test,trigger,deploy}.mdx— new "Cancelling a run" / "Cancelling a deploy" section describing Ctrl+C behaviour.Needs verification before merge
See inline review comments on this PR — they pinpoint the exact lines.
cli/checkly-*.mdxfiles. Each section has a{/* TODO */}comment and anAvailable in CLI vX.X+.placeholder. The Ctrl+C cancel logic lives in the checkly-cli repo, which I didn't read — Ferran should fill in (or remove) the version notes.test/trigger/deployas "cancel-or-detach with detach default" andpw-testas "no detach prompt; second Ctrl+C exits without waiting." This came from the project spec, not from reading the CLI source — please confirm.npm run devto confirm the four new OpenAPI-driven pages render cleanly and the new sidebar entries appear under the right groups.Known follow-up — tracked separately
RED-512 — Empty/partial request/response examples on the new API reference pages.
Three distinct issues, all in the backend's OpenAPI generation:
POST /v1/cancelbody renders as "any" — its request body refs#/x-alt-definitions/CancelCheckSessionand#/x-alt-definitions/CancelTestSession. The schemas exist but live underx-alt-definitionsinstead ofcomponents/schemas, which Mintlify can't resolve.schema: { type: "string" }with no$ref, no 2xx status code, and no error responses.POST /v2/check-sessions/triggerhas no request body schema at all —requestBody: {}is empty in the spec.The fix lives in the backend route definitions (
apps/backend/api/src/modules/public-api/check-sessions/v2/routes.tsand.../cancel/routes.ts) and will propagate to the docs repo via the next 48h CI sync. The docs PR can ship before that lands.Test plan
npm run devand visit/concepts/cancellation— copy reads cleanly, all links resolve./concepts/results,/communicate/alerts/configuration, and the fourcli/*pages — new sections appear in the right place.Available in CLI vX.X+.placeholders.🤖 Generated with Claude Code